<!--
	修改日期:2017年5月2日
	界面责任人:XF
-->
<!doctype html>
<html lang="zh">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>速报视图自动发布后台管理系统</title>
	<link rel="stylesheet" type="text/css" href="$CSS/styles.css">
</head>

<script>
	window.onload = function () {
		let userAgentInfo = navigator.userAgent;
		let Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
		let agentinfo = null;
		for (var i = 0; i < Agents.length; i++) {
			if (userAgentInfo.indexOf(Agents[i]) > 0) {
				agentinfo = userAgentInfo;
				break;
			}
		}
		if (agentinfo) {
			window.location.href = "/NewSubao/public/index/Login/indexphone";
		}
	}
</script>

<body>
	<!-- 代码 开始 -->
	<div class="wrapper">
		<div class="container">
			<h1>速报视图自动发布后台管理系统</h1>
			<br><br><br><br>
			<form class="form" id="myform" method="post">
				<p><span>用户名:</span><input type="text" placeholder="用户名" id="userName" name="userName"></p>
				<p><span>密&nbsp&nbsp&nbsp码:</span><input type="password" id="passWord" placeholder="密码" name="passWord"></p>
				<p><span>验证码:</span><input type="text" class="verify" id="captcha" name="captcha" placeholder="验证码">
					<img src="/NewSubao/public/index/login/createVerifyCode" onclick="this.src='/NewSubao/public/index/login/createVerifyCode?'+new Date().getTime();"
					 width=120; height=43>
				</p>
				<button type="submit" id="login-button">登录</button>
			</form>
		</div>

		<ul class="bg-bubbles">
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
		</ul>
	</div>

	<script src="$JS/jquery-2.1.1.min.js" type="text/javascript"></script>
	<script>

		$('#login-button').click(function () {
			$.post('/NewSubao/public/index/Login/submit', {
				user: $('#userName')[0].value,
				password: $('#passWord')[0].value,
				input_captcha: $('#captcha')[0].value,
			},
				function (data) {
					let res = JSON.parse(data)
					if (res.code == 900) {
						$('form').fadeOut(50);
						$('.wrapper').addClass('form-success');
						setTimeout("window.location.href = '/NewSubao/public/index';", 1000)
					} else if (res.code == 901 || res.code == 902 || res.code == 903) {
						alert(res.msg);
					} else {
						alert("网络错误");
					}
				})

			return false;
		})


// $('#login-button').click(function (event) {
// 	event.preventDefault();
// 	$('form').fadeOut(50);
// 	$('.wrapper').addClass('form-success');
// 	setTimeout("document.getElementById('myform').submit(); ",1000);//延时1秒 
// });
	</script>
	<!-- 代码 结束 -->

	<div class="footer" style="text-align:center;font:normal 14px/24px 'MicroSoft YaHei';color:#000000">
		<br><br><br><br><br><br><br><br><br><br><br><br>
		<br><br><br><br><br><br><br><br><br><br><br><br>
		<h4 style="margin: 80px 0 0 0;font-weight:20px;">联系电话：13700349482</h4>
		<h4 style="margin: 10px 0 0 0;">本系统版权归属 防灾科技学院GIS协会 所有 Copyright All</h4>
		<p>
			<center style="display:none">
				<script src="$JS/c.js"></script>
				<script src="$JS/demo_tj.js"></script>
			</center>
		</p>
	</div>

</body>

</html>